package webRequest;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

@WebServlet("/req2")
public class Demo2 extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("get.......");

        Map<String,String []> map=req.getParameterMap();

        for (String key :
                map.keySet()) {
            System.out.println(key+" ");

            String [] values =map.get(key);
            for (String value:values ) {
                System.out.println(value+" ");
            }
            System.out.println();
        }
        String name=req.getParameter("username");
        String psw=req.getParameter("password");
        System.out.println("name"+name);
        System.out.println("password"+psw);

    }
}
